#include <iostream>
#include <unistd.h>
#include <cassert>
#include <sys/wait.h>
#include <signal.h>
using namespace std;

void handler(int signo)
{
    sigset_t pending;
    sigemptyset(&pending);
    int n=sigpending(&pending);
    assert(n==0);
    cout<<"抵达中..."<<endl;
}

int main()
{
    sigset_t block,oblock;
    sigemptyset(&block);
    sigemptyset(&oblock);
    sigaddset(&block,2);
    int n=sigprocmask(SIG_SETMASK,&block,&oblock);
    assert(n==0);
    cout<<"block 2 signal success"<<endl;
    cout<<"pid:"<<getpid()<<endl;
    int cnt=0;
    while(true)
    {
        sigset_t pending;
        sigemptyset(&pending);
    }
    return 0;
}
